﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using HotelManagement.Repository;
using HotelManagementModel;

namespace HotelManagementApi.Controllers
{
    public class ValuesController : ApiController
    {
        [Ninject.Inject]
        public IRepository _IRepository { set; get; }


        // GET api/values/5
        public IList<User> Get()
        {
            IList<User> list = _IRepository.UserSelect();
            return list;
        }

        // POST api/values
        public int  Post(User u)
        {
            int a = _IRepository.UserInser(u);
            return a;
        }

        // PUT api/values/5
        public int Put(User u)
        {
            int a = _IRepository.UserInser(u);
            return a;
        }

        // DELETE api/values/5
        public int Delete(int id)
        {
            int a = _IRepository.UserDelete(id);
            return a;
        }
    }
}
